<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML>
<html>
<head>
    <title>援藏路线修改</title>
    <base href="${pageContext.request.contextPath }/"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="./Process/style.css"/>
    <script type="text/javascript" src="./Process/create.js"></script>
    <script type="text/javascript" src="./Js/jquery.js"></script>
</head>
<body>
<div>
    路线名称：
    <input type="text" id="title" value="${process.title}"/>
    <br/>
    <input type="text" value="${process.info}" style="width: 300px;" id="info" placeholder=""/>
<%--    <input type="button" value="增加" onclick="add();"/>--%>
    <input type="button" id="submit" value="提交"/>
</div>
</body>
<script type="text/javascript">
    $("#submit").click(function () {
        var id='';
        id = ${process.id};
        var title = $("#title").val();
        var info = $("#info").val();
        var param = "id="+id+"&title="+title+"&info="+info+"&operator=${username}";
        $.ajax({
            url: "/process/update",
            type: "post",
            async: true,
            data: param,
            success: function (res) {
                if (res.success) {
                    alert("修改成功！")
                    window.location.href = "/process/list";
                } else {
                    alert(res.message);
                }
            },
            error: function (e) {
                alert(e);
            }
        })
    })

</script>
</html>